﻿using BoostSite.Demo.Definitions.Templates.PageTypes.General;
using EPiBoost.Core.Extensions;
using EPiServer.Core;
using System.Linq;

namespace BoostSite.Demo.Definitions
{
	public static class SiteConfiguration
	{
		public static Templates.SharedBlockTypes.General.SiteConfigurationBlock SiteSettings
		{
			get { return Pages.StartPage.ConfigurationBlocks.GetFirst<Templates.SharedBlockTypes.General.SiteConfigurationBlock>(); }
		}

		public static class Pages
		{
			public static StartPage StartPage
			{
				get { return PageReference.StartPage.GetPage<StartPage>(); }
			}

			public static ErrorPage ErrorPage
			{
				get
				{
					try
					{
						return SiteSettings.ErrorPage.GetPage<ErrorPage>();
					}
					catch
					{
						return null;
					}
				}
			}
		}

		public static class ErrorHandling
		{ 
			public static string Error500Path = "/Content/html/500.htm";
		}

	}
}
